package tools

import (
	"errors"
	"io/ioutil"
	"log"
	"net/http"
)

func Notify() error {
	// 发送 http 请求
	var noticeUrl = "http://127.0.0.1"
	res, err := http.Get(noticeUrl)

	if err != nil {
		return errors.New(err.Error())
	}

	defer res.Body.Close()

	body, err := ioutil.ReadAll(res.Body)
	if err != nil {
		return errors.New(err.Error())
	}

	log.Println("通知返回res.body：", string(body))
	return nil
}
